package com.csdj.t301.util;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * author:cloud
 * date:2021/3/15 0015
 **/
public class ProxyHander<T> implements InvocationHandler {

    private T target;

    public void setTarget(T t){
        this.target = t;
    }

    public ProxyHander(){}
    public ProxyHander(T t){this.target = t;}

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        return method.invoke(this.target,args);
    }
}
